package com.veng.springbootdemo.service;

import com.veng.springbootdemo.vo.User;
import javax.servlet.http.HttpSession;
import java.util.List;

public interface UserService {
    public User getUser() ;

    /**
     * 验证用户
     * @param session
     * @param username 待验证用户名
     * @param password 待验证密码
     * @throws UserServiceImp.UserNotExistException 用户不存在异常
     * @throws UserServiceImp.PasswordErrorException 密码错误异常
     */
    public void login(HttpSession session,String username,String password) throws UserServiceImp.UserNotExistException, UserServiceImp.PasswordErrorException, UserServiceImp.UsernameEmptyException, UserServiceImp.PasswordEmptyException;

    /**
     * 注册
     * @param username 注册用户名
     * @param password 密码
     * @param email 邮箱
     */
    public void register(String username,String password,String email) throws UserServiceImp.UsernameEmptyException, UserServiceImp.PasswordEmptyException, UserServiceImp.EmailEmptyException, UserServiceImp.EmailInvalidException, UserServiceImp.UserExistException, UserServiceImp.EmailExistException;





    /**
     * 分页 找所有用户
     * @return
     */
    List<com.veng.springbootdemo.po.User> findAll(int page,int size);


    /**
     * 用户名 排序第一
     * @return
     */
    com.veng.springbootdemo.po.User findFirstByUsername();

    /**
     * 修改密码根据用户名
     * @param username 用户名
     * @param password 更正后的密码
     */
    void modifyPasswordByUsername(String username,String password);
}
